﻿Imports DevComponents.Editors.DateTimeAdv
Imports DevComponents.DotNetBar.Controls
Imports TNCBAL
Imports TNCDAL

Public Module GlobalModule
    Friend LoginOK As Boolean = False

    Public Enum enumFILE
        Import = False
        Export = True
    End Enum

    Public Enum enumROLE
        GUEST = 1
        SALES_DOCUMENTATION = 2
        ACCOUNTING = 3
        BOARD = 4
        ADMINISTRATOR = 5
    End Enum

    ''' <summary>
    ''' Cho biết hành động thực hiện được ghi vào log
    ''' </summary>
    ''' <remarks></remarks>
    Public Enum enumAction
        Add = 1
        Edit = 2
        Delete = 3
        LogIn = 4
        LogOut = 5
    End Enum

    Public Function LocPhanQuyen(ByVal loai As enumROLE) As Integer
        Dim role_id As Integer = -1
        Select Case loai
            Case enumROLE.GUEST
                role_id = 1
            Case enumROLE.SALES_DOCUMENTATION
                role_id = 2
            Case enumROLE.ACCOUNTING
                role_id = 3
            Case enumROLE.BOARD
                role_id = 4
            Case enumROLE.ADMINISTRATOR
                role_id = 5
        End Select
        Return role_id
    End Function

    'Friend ReadOnly FORMAT_MONEY As String = "#,##0.##"
    'Public Function FormatMoneyStyle(ByVal value) As String
    '    Dim strFormat = "{0:" + FORMAT_MONEY + "}"
    '    Return String.Format(strFormat, value) '"{0:#,##0.##}" '"#,##0.##"
    'End Function

    'Friend ReadOnly FORMAT_QUANTITY As String = "#,##0.##"
    'Public Function FormatQuantityStyle(ByVal value) As String
    '    Dim strFormat = "{0:" + FORMAT_QUANTITY + "}"
    '    Return String.Format(strFormat, value) '"{0:#,##0.##}" '"#,##0.##"
    '    'Return String.Format("{0:#,##0.##}", value) '"{0:#,##0.##}" '"#,##0.##"
    'End Function

    'Public Function FormatDateStyle() As String
    '    Return "dd/MM/yyyy"
    'End Function

End Module
